<#if pagination??>
<script type="text/javascript" src="${base}/js/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="${base}/js/lhgdialog/lhgdialog.min.js"></script>
<script type="text/javascript">
function myAlert1(txt,isRefresh){
	window.parent.$.dialog({
		lock: true,
		content: txt,
		cancelVal: '确定',
		autoSize:true,
	    cancel: function(){ //请求成功后处理函数。 
		}
	});
}

	$(function(){
			//初始化每页条数
			var pageSize = $("#pageSize").val();
			if ( pageSize==null||pageSize == 20 ) {
				document.getElementById( 'selectPageSize' ).options[0].selected = true;
			} else if ( pageSize == 50 ) {
				document.getElementById( 'selectPageSize' ).options[1].selected = true;
			} else if ( pageSize == 100 ) {
				document.getElementById( 'selectPageSize' ).options[2].selected = true;
			} else if ( pageSize == 200 ) {
				document.getElementById( 'selectPageSize' ).options[3].selected = true;
			} else {
				document.getElementById( 'selectPageSize' ).value = pageSize;
			}
			
	});
	
	function _gotoPage(pageNo) {
		if($("#totalPage").val()==null||$("#totalPage").val()==''||parseInt(pageNo)<0||parseInt(pageNo)>parseInt($("#totalPage").val())){
			myAlert1("输入的页数必须小于总页数");
			return;
		}
			try{
				var tableForm = $("#tableForm");
				$("input[name=pageNo]").val(pageNo);
				tableForm.submit();
			} catch(e) {
				alert('_gotoPage(pageNo)方法出错');
			}
		}

	function chooseAll(c){
		var checkBoxArray=$("input[name='ids']");
		for(var i=0;i<checkBoxArray.length;i++){
			if(c){	
				checkBoxArray.eq(i).attr("checked",true);
			}else{
				checkBoxArray.eq(i).removeAttr("checked");
			}
		}
	
	}
	function changePageSize( pageSize ) {
		try{
			$("input[name=pageNo]").val(1);
			var tableForm = document.getElementById( 'tableForm' );
			$("input[name=pageSize]").val(pageSize);
			tableForm.submit();
		} catch(e) {
			alert('changePageSize(pageSize)方法出错');
		}
	}

</script>
<table cellspacing="5" cellpadding="0" border="0">
    <input type="hidden" name="pageNo" value="${pagination.pageNo!}"/>
	<input type="hidden" value ="${pagination.pageSize!}" id="pageSize" name ="pageSize" />
	<input type="hidden" value ="${pagination.totalPage!}" id="totalPage" name ="totalPage" />
	<tr>
		<td align="center" class="pn-sp" style="font-weight:bold">
			共 ${pagination.totalCount} 条 每页
			<select id="selectPageSize"
				onkeypress="if(event.keyCode==13){$(this).blur();return false;}"
				onchange="changePageSize(this.options[this.options.selectedIndex].value)">
				<option value="20"  >
					20
				</option>
				<option value="50"  >
					50
				</option>
				<option value="100"  >
					100
				</option>
				<option value="200" >
					200
				</option>
			</select>
			条
			<input class="page_btn" type="button" value="[首 页]"  onclick="_gotoPage('1');"  <#if pagination.firstPage> disabled="disabled" <#else>style="cursor:pointer"</#if>/> 
			<input class="page_btn" type="button" value="[上一页]" onclick="_gotoPage('${pagination.prePage}');" <#if pagination.firstPage> disabled="disabled" <#else>style="cursor:pointer"</#if>/> 
			<input class="page_btn" type="button" value="[下一页]" onclick="_gotoPage('${pagination.nextPage}');" <#if pagination.lastPage> disabled="disabled" <#else>style="cursor:pointer"</#if>/> 
			<input class="page_btn" type="button" value="[尾 页]" onclick="_gotoPage('${pagination.totalPage}');" <#if pagination.lastPage> disabled="disabled" <#else>style="cursor:pointer"</#if>/>
			当前${pagination.pageNo}/${pagination.totalPage} 页 转到第 
			<input type="text" id="_goPs" style="width: 50px" onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')" onfocus="this.select();" onkeypress="if(event.keyCode==13){$('#_goPage').click();return false;}" />
			页
			<input class="page_btn" id="_goPage" type="button" value="确定" onclick="_gotoPage($('#_goPs').val());" <#if pagination.totalPage==1> disabled="disabled" <#else>style="cursor:pointer"</#if> /> </td>
	</tr>
</table>
</#if>